package com.yuehuanghun.admin.generator.mapper;

import java.util.List;
import java.util.Map;
import java.util.Optional;

import com.yuehuanghun.admin.generator.domain.GenTable;
import com.yuehuanghun.mybatis.milu.BaseMapper;
import com.yuehuanghun.mybatis.milu.annotation.NamingQuery;

/**
 * 业务 数据层
 * 
 * @author yadmin
 */
public interface GenTableMapper extends BaseMapper<GenTable, Long> {

	/**
	 * 按tableName查找唯一
	 * @param tableName 表名
	 * @return
	 */
	@NamingQuery
	public Optional<GenTable> findByTableName(String tableName);

	/**
	 * 本方法为注入sql直接执行，不允许对外部查询使用
	 * @see com.yuehuanghun.admin.generator.model.dialect.MysqlDialect
	 * @see com.yuehuanghun.admin.generator.model.dialect.OracleDialect
	 * @param sql 注入的完整sql
	 * @return
	 */
	public List<Map<String, Object>> getForMap(String sql);
}
